.class public Lcom/glympse/android/glympse/ViewSearch$SearchResultAdapter;
.super Landroid/widget/ArrayAdapter;
.source "ViewSearch.java"

# interfaces
.implements Landroid/widget/AdapterView$OnItemClickListener;


# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/glympse/android/glympse/ViewSearch;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x9
    name = "SearchResultAdapter"
.end annotation

.annotation system Ldalvik/annotation/Signature;
    value = {
        "Landroid/widget/ArrayAdapter",
        "<",
        "Lcom/glympse/platform/common/SearchResult;",
        ">;",
        "Landroid/widget/AdapterView$OnItemClickListener;"
    }
.end annotation


# instance fields
.field private m_oLayoutInflater:Landroid/view/LayoutInflater;


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/ArrayList;)V
    .locals 1
    .parameter "oContext"
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/content/Context;",
            "Ljava/util/ArrayList",
            "<",
            "Lcom/glympse/platform/common/SearchResult;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 338
    .local p2, listSettings:Ljava/util/ArrayList;,"Ljava/util/ArrayList<Lcom/glympse/platform/common/SearchResult;>;"
    const/4 v0, 0x0

    invoke-direct {p0, p1, v0, p2}, Landroid/widget/ArrayAdapter;-><init>(Landroid/content/Context;ILjava/util/List;)V

    .line 333
    const/4 v0, 0x0

    iput-object v0, p0, Lcom/glympse/android/glympse/ViewSearch$SearchResultAdapter;->m_oLayoutInflater:Landroid/view/LayoutInflater;

    .line 339
    invoke-static {p1}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/glympse/android/glympse/ViewSearch$SearchResultAdapter;->m_oLayoutInflater:Landroid/view/LayoutInflater;

    .line 340
    return-void
.end method


# virtual methods
.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 5
    .parameter "nPosition"
    .parameter "oConvertView"
    .parameter "oParent"

    .prologue
    .line 345
    iget-object v2, p0, Lcom/glympse/android/glympse/ViewSearch$SearchResultAdapter;->m_oLayoutInflater:Landroid/view/LayoutInflater;

    const v3, 0x7f03001c

    const/4 v4, 0x0

    invoke-virtual {v2, v3, p3, v4}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;Z)Landroid/view/View;

    move-result-object v1

    .line 346
    .local v1, oView:Landroid/view/View;
    invoke-virtual {p0, p1}, Lcom/glympse/android/glympse/ViewSearch$SearchResultAdapter;->getItem(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/glympse/platform/common/SearchResult;

    .line 347
    .local v0, oSearchResult:Lcom/glympse/platform/common/SearchResult;
    const v2, 0x7f0c0004

    invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p0

    .end local p0
    check-cast p0, Landroid/widget/TextView;

    iget-object v2, v0, Lcom/glympse/platform/common/SearchResult;->m_strTitle:Ljava/lang/String;

    invoke-virtual {p0, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 348
    const v2, 0x7f0c0005

    invoke-virtual {v1, v2}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object p0

    check-cast p0, Landroid/widget/TextView;

    iget-object v2, v0, Lcom/glympse/platform/common/SearchResult;->m_strAddress:Ljava/lang/String;

    invoke-virtual {p0, v2}, Landroid/widget/TextView;->setText(Ljava/lang/CharSequence;)V

    .line 349
    return-object v1
.end method

.method public onItemClick(Landroid/widget/AdapterView;Landroid/view/View;IJ)V
    .locals 7
    .parameter
    .parameter "oView"
    .parameter "nPosition"
    .parameter "nId"
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Landroid/widget/AdapterView",
            "<*>;",
            "Landroid/view/View;",
            "IJ)V"
        }
    .end annotation

    .prologue
    .line 355
    .local p1, oAdapterView:Landroid/widget/AdapterView;,"Landroid/widget/AdapterView<*>;"
    sget-object v0, Lcom/glympse/android/glympse/Glympse$EViews;->Destination:Lcom/glympse/android/glympse/Glympse$EViews;

    sget-object v1, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    invoke-virtual {v1}, Lcom/glympse/android/glympse/Glympse;->GetCurrentEView()Lcom/glympse/android/glympse/Glympse$EViews;

    move-result-object v1

    if-eq v0, v1, :cond_0

    .line 357
    invoke-virtual {p1, p3}, Landroid/widget/AdapterView;->getItemAtPosition(I)Ljava/lang/Object;

    move-result-object v6

    check-cast v6, Lcom/glympse/platform/common/SearchResult;

    .line 358
    .local v6, oSearchResult:Lcom/glympse/platform/common/SearchResult;
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    iget-object v0, v0, Lcom/glympse/android/glympse/Glympse;->m_oViewDestination:Lcom/glympse/android/glympse/ViewDestination;

    .line 359
    iget-object v1, v6, Lcom/glympse/platform/common/SearchResult;->m_strTitle:Ljava/lang/String;

    .line 360
    iget-wide v2, v6, Lcom/glympse/platform/common/SearchResult;->m_dLatitude:D

    .line 361
    iget-wide v4, v6, Lcom/glympse/platform/common/SearchResult;->m_dLongitude:D

    .line 358
    invoke-virtual/range {v0 .. v5}, Lcom/glympse/android/glympse/ViewDestination;->SetDestination(Ljava/lang/String;DD)V

    .line 362
    sget-object v0, Lcom/glympse/android/glympse/Glympse;->ms_oThis:Lcom/glympse/android/glympse/Glympse;

    sget-object v1, Lcom/glympse/android/glympse/Glympse$EViews;->Destination:Lcom/glympse/android/glympse/Glympse$EViews;

    sget-object v2, Lcom/glympse/android/glympse/Glympse$EAnimations;->SlideLeft:Lcom/glympse/android/glympse/Glympse$EAnimations;

    sget-object v3, Lcom/glympse/android/glympse/Glympse$EAnimations;->SlideRight:Lcom/glympse/android/glympse/Glympse$EAnimations;

    invoke-virtual {v0, v1, v2, v3}, Lcom/glympse/android/glympse/Glympse;->PushView(Lcom/glympse/android/glympse/Glympse$EViews;Lcom/glympse/android/glympse/Glympse$EAnimations;Lcom/glympse/android/glympse/Glympse$EAnimations;)Lcom/glympse/android/glympse/Glympse$EViews;

    .line 364
    .end local v6           #oSearchResult:Lcom/glympse/platform/common/SearchResult;
    :cond_0
    return-void
.end method
